
import requests


class RequestsClient:

    session = requests.session()

    # 要发起一个接口的调用需要用到哪些信息
    def __init__(self):
        self.url = None
        self.method = None
        self.headers = None
        self.params = None
        self.data = None
        self.json = None
        self.files = None
        self.resp = None

    def send(self):
        # verify=False 该参数表示忽略https的证书校验
        self.resp = RequestsClient.session.request(method=self.method,
                                                   url=self.url,
                                                   headers=self.headers,
                                                   params=self.params,
                                                   data=self.data,
                                                   json=self.json,
                                                   files=self.files,
                                                   verify=False)
        return self.resp